<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>

    function fn(){
        console.log(this)
    }

    // 默认绑定
    fn();       // window

    const obj = {
        name:"obj"
    }
    obj.show = fn;
    // 隐式绑定
    obj.show();     // obj

    // 隐式丢失
    const a = obj.show;
    a();        // window

    const foo = {
        name:"foo",
        run:function(a){
            a();
        }
    }
    foo.run( obj.show );        // window

    // 强制绑定
    fn.call("hello");
    fn.apply(123);
    fn.bind(true)();

    // 修复隐式丢失
    const b = obj.show.bind(obj);
    foo.run( b );       // obj


    // =========








</script>
</html>